/*
Navicat SQL Server Data Transfer

Source Server         : 
Source Server Version : 90000
Source Host           : :1433
Source Database       : erp
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 90000
File Encoding         : 65001

Date: 2017-12-29 16:31:41
*/


-- ----------------------------
-- Table structure for jsh_app
-- ----------------------------
DROP TABLE [dbo].[jsh_app]
GO
CREATE TABLE [dbo].[jsh_app] (
[Id] bigint NOT NULL IDENTITY(10,1) ,
[Number] nvarchar(50) NULL DEFAULT NULL ,
[Name] nvarchar(50) NULL DEFAULT NULL ,
[Type] nvarchar(50) NULL DEFAULT NULL ,
[Icon] nvarchar(50) NULL DEFAULT NULL ,
[URL] nvarchar(50) NULL DEFAULT NULL ,
[Width] nvarchar(50) NULL DEFAULT NULL ,
[Height] nvarchar(50) NULL DEFAULT NULL ,
[ReSize] bit NULL DEFAULT NULL ,
[OpenMax] bit NULL DEFAULT NULL ,
[Flash] bit NULL DEFAULT NULL ,
[ZL] nvarchar(50) NULL DEFAULT NULL ,
[Sort] nvarchar(50) NULL DEFAULT NULL ,
[Remark] nvarchar(200) NULL DEFAULT NULL ,
[Enabled] bit NULL DEFAULT NULL 
)


GO

-- ----------------------------
-- Records of jsh_app
-- ----------------------------
SET IDENTITY_INSERT [dbo].[jsh_app] ON
GO
INSERT INTO [dbo].[jsh_app] ([Id], [Number], [Name], [Type], [Icon], [URL], [Width], [Height], [ReSize], [OpenMax], [Flash], [ZL], [Sort], [Remark], [Enabled]) VALUES (N'3', N'00', N'管理', N'app', N'0000000004.png', N'', N'1350', N'630', N'1', N'1', N'1', N'desk', N'024', N'', N'1')
GO
GO
INSERT INTO [dbo].[jsh_app] ([Id], [Number], [Name], [Type], [Icon], [URL], [Width], [Height], [ReSize], [OpenMax], [Flash], [ZL], [Sort], [Remark], [Enabled]) VALUES (N'6', N'', N'个人信息', N'app', N'0000000005.png', N'../user/password.jsp', N'600', N'400', N'1', N'1', N'1', N'dock', N'200', N'', N'1')
GO
GO
INSERT INTO [dbo].[jsh_app] ([Id], [Number], [Name], [Type], [Icon], [URL], [Width], [Height], [ReSize], [OpenMax], [Flash], [ZL], [Sort], [Remark], [Enabled]) VALUES (N'7', N'01', N'计划', N'app', N'0000000019.png', null, N'1350', N'630', N'1', N'1', N'1', N'desk', N'025', null, N'1')
GO
GO
INSERT INTO [dbo].[jsh_app] ([Id], [Number], [Name], [Type], [Icon], [URL], [Width], [Height], [ReSize], [OpenMax], [Flash], [ZL], [Sort], [Remark], [Enabled]) VALUES (N'8', N'02', N'生产', N'app', N'0000000018.png', null, N'1350', N'630', N'1', N'1', N'1', N'desk', N'026', null, N'1')
GO
GO
INSERT INTO [dbo].[jsh_app] ([Id], [Number], [Name], [Type], [Icon], [URL], [Width], [Height], [ReSize], [OpenMax], [Flash], [ZL], [Sort], [Remark], [Enabled]) VALUES (N'9', N'03', N'采购', N'app', N'buy.png', null, N'1350', N'630', N'1', N'1', N'1', N'desk', N'027', null, N'1')
GO
GO
SET IDENTITY_INSERT [dbo].[jsh_app] OFF
GO

-- ----------------------------
-- Table structure for jsh_functions
-- ----------------------------
DROP TABLE [dbo].[jsh_functions]
GO
CREATE TABLE [dbo].[jsh_functions] (
[Id] bigint NOT NULL IDENTITY(22,1) ,
[Number] nvarchar(50) NULL DEFAULT NULL ,
[Name] nvarchar(50) NULL DEFAULT NULL ,
[PNumber] nvarchar(50) NULL DEFAULT NULL ,
[URL] nvarchar(100) NULL DEFAULT NULL ,
[State] bit NULL DEFAULT NULL ,
[Sort] nvarchar(50) NULL DEFAULT NULL ,
[Enabled] bit NULL DEFAULT NULL ,
[Type] nvarchar(50) NULL DEFAULT NULL ,
[PushBtn] nvarchar(50) NULL DEFAULT NULL 
)


GO

-- ----------------------------
-- Records of jsh_functions
-- ----------------------------
SET IDENTITY_INSERT [dbo].[jsh_functions] ON
GO
INSERT INTO [dbo].[jsh_functions] ([Id], [Number], [Name], [PNumber], [URL], [State], [Sort], [Enabled], [Type], [PushBtn]) VALUES (N'1', N'00', N'管理', N'0', N'', N'1', N'0010', N'1', N'电脑版', N'')
GO
GO
INSERT INTO [dbo].[jsh_functions] ([Id], [Number], [Name], [PNumber], [URL], [State], [Sort], [Enabled], [Type], [PushBtn]) VALUES (N'11', N'0001', N'管理', N'00', N'', N'1', N'0110', N'1', N'电脑版', null)
GO
GO
INSERT INTO [dbo].[jsh_functions] ([Id], [Number], [Name], [PNumber], [URL], [State], [Sort], [Enabled], [Type], [PushBtn]) VALUES (N'12', N'000101', N'应用管理', N'0001', N'../manage/app.jsp', N'1', N'0132', N'1', N'电脑版', N'')
GO
GO
INSERT INTO [dbo].[jsh_functions] ([Id], [Number], [Name], [PNumber], [URL], [State], [Sort], [Enabled], [Type], [PushBtn]) VALUES (N'13', N'000102', N'角色管理', N'0001', N'../manage/role.jsp', N'1', N'0130', N'1', N'电脑版', N'')
GO
GO
INSERT INTO [dbo].[jsh_functions] ([Id], [Number], [Name], [PNumber], [URL], [State], [Sort], [Enabled], [Type], [PushBtn]) VALUES (N'14', N'000103', N'用户管理', N'0001', N'../manage/user.jsp', N'1', N'0140', N'1', N'电脑版', null)
GO
GO
INSERT INTO [dbo].[jsh_functions] ([Id], [Number], [Name], [PNumber], [URL], [State], [Sort], [Enabled], [Type], [PushBtn]) VALUES (N'15', N'000104', N'日志管理', N'0001', N'../manage/log.jsp', N'1', N'0160', N'1', N'电脑版', null)
GO
GO
INSERT INTO [dbo].[jsh_functions] ([Id], [Number], [Name], [PNumber], [URL], [State], [Sort], [Enabled], [Type], [PushBtn]) VALUES (N'16', N'000105', N'功能管理', N'0001', N'../manage/functions.jsp', N'1', N'0135', N'1', N'电脑版', null)
GO
GO
INSERT INTO [dbo].[jsh_functions] ([Id], [Number], [Name], [PNumber], [URL], [State], [Sort], [Enabled], [Type], [PushBtn]) VALUES (N'17', N'01', N'计划', N'0', null, N'1', N'0100', N'1', N'电脑版', null)
GO
GO
INSERT INTO [dbo].[jsh_functions] ([Id], [Number], [Name], [PNumber], [URL], [State], [Sort], [Enabled], [Type], [PushBtn]) VALUES (N'18', N'0101', N'计划', N'01', null, N'1', N'0101', N'1', N'电脑版', null)
GO
GO
INSERT INTO [dbo].[jsh_functions] ([Id], [Number], [Name], [PNumber], [URL], [State], [Sort], [Enabled], [Type], [PushBtn]) VALUES (N'19', N'010101', N'工单计划', N'0101', N'../schedule/schedule.jsp', N'1', N'0102', N'1', N'电脑版', null)
GO
GO
INSERT INTO [dbo].[jsh_functions] ([Id], [Number], [Name], [PNumber], [URL], [State], [Sort], [Enabled], [Type], [PushBtn]) VALUES (N'20', N'010102', N'计划核编', N'0101', N'../schedule/scheduleCheck.jsp', N'1', N'0103', N'1', N'电脑版', null)
GO
GO
INSERT INTO [dbo].[jsh_functions] ([Id], [Number], [Name], [PNumber], [URL], [State], [Sort], [Enabled], [Type], [PushBtn]) VALUES (N'21', N'010103', N'历史计划', N'0101', N'../schedule/scheduleHistory.jsp', N'1', N'0104', N'1', N'电脑版', null)
GO
GO
SET IDENTITY_INSERT [dbo].[jsh_functions] OFF
GO

-- ----------------------------
-- Table structure for jsh_log
-- ----------------------------
DROP TABLE [dbo].[jsh_log]
GO
CREATE TABLE [dbo].[jsh_log] (
[id] bigint NOT NULL IDENTITY(1,1) ,
[userID] bigint NOT NULL ,
[operation] nvarchar(500) NULL DEFAULT NULL ,
[clientIP] nvarchar(50) NULL DEFAULT NULL ,
[createtime] datetime NULL DEFAULT NULL ,
[status] smallint NULL DEFAULT NULL ,
[contentdetails] nvarchar(1000) NULL DEFAULT NULL ,
[remark] nvarchar(500) NULL DEFAULT NULL 
)


GO
DBCC CHECKIDENT(N'[dbo].[jsh_log]', RESEED, 2)
GO

-- ----------------------------
-- Records of jsh_log
-- ----------------------------
SET IDENTITY_INSERT [dbo].[jsh_log] ON
GO
SET IDENTITY_INSERT [dbo].[jsh_log] OFF
GO

-- ----------------------------
-- Table structure for jsh_role
-- ----------------------------
DROP TABLE [dbo].[jsh_role]
GO
CREATE TABLE [dbo].[jsh_role] (
[Id] bigint NOT NULL IDENTITY(5,1) ,
[Name] nvarchar(50) NULL DEFAULT NULL ,
[type] nvarchar(50) NULL DEFAULT NULL ,
[value] nvarchar(200) NULL DEFAULT NULL ,
[description] nvarchar(100) NULL DEFAULT NULL 
)


GO

-- ----------------------------
-- Records of jsh_role
-- ----------------------------
SET IDENTITY_INSERT [dbo].[jsh_role] ON
GO
INSERT INTO [dbo].[jsh_role] ([Id], [Name], [type], [value], [description]) VALUES (N'4', N'管理员', null, null, null)
GO
GO
SET IDENTITY_INSERT [dbo].[jsh_role] OFF
GO

-- ----------------------------
-- Table structure for jsh_user
-- ----------------------------
DROP TABLE [dbo].[jsh_user]
GO
CREATE TABLE [dbo].[jsh_user] (
[id] bigint NOT NULL IDENTITY(64,1) ,
[username] nvarchar(255) NOT NULL ,
[loginame] nvarchar(255) NULL DEFAULT NULL ,
[password] nvarchar(50) NULL DEFAULT NULL ,
[position] nvarchar(200) NULL DEFAULT NULL ,
[department] nvarchar(255) NULL DEFAULT NULL ,
[email] nvarchar(100) NULL DEFAULT NULL ,
[phonenum] nvarchar(100) NULL DEFAULT NULL ,
[ismanager] smallint NOT NULL DEFAULT ((1)) ,
[isystem] smallint NOT NULL DEFAULT ((1)) ,
[status] smallint NULL DEFAULT NULL ,
[description] nvarchar(500) NULL DEFAULT NULL ,
[remark] nvarchar(500) NULL DEFAULT NULL 
)


GO

-- ----------------------------
-- Records of jsh_user
-- ----------------------------
SET IDENTITY_INSERT [dbo].[jsh_user] ON
GO
INSERT INTO [dbo].[jsh_user] ([id], [username], [loginame], [password], [position], [department], [email], [phonenum], [ismanager], [isystem], [status], [description], [remark]) VALUES (N'63', N'管理员', N'admin', N'81dc9bdb52d04dc20036dbd8313ed055', N'', N'', N'', N'', N'0', N'1', N'-1', N'', null)
GO
GO
SET IDENTITY_INSERT [dbo].[jsh_user] OFF
GO

-- ----------------------------
-- Table structure for jsh_userbusiness
-- ----------------------------
DROP TABLE [dbo].[jsh_userbusiness]
GO
CREATE TABLE [dbo].[jsh_userbusiness] (
[Id] bigint NOT NULL IDENTITY(17,1) ,
[Type] nvarchar(50) NULL DEFAULT NULL ,
[KeyId] nvarchar(50) NULL DEFAULT NULL ,
[Value] nvarchar(MAX) NULL DEFAULT NULL ,
[BtnStr] nvarchar(2000) NULL DEFAULT NULL 
)


GO

-- ----------------------------
-- Records of jsh_userbusiness
-- ----------------------------
SET IDENTITY_INSERT [dbo].[jsh_userbusiness] ON
GO
INSERT INTO [dbo].[jsh_userbusiness] ([Id], [Type], [KeyId], [Value], [BtnStr]) VALUES (N'1', N'RoleAPP', N'4', N'[3][7][8][9][6]', null)
GO
GO
INSERT INTO [dbo].[jsh_userbusiness] ([Id], [Type], [KeyId], [Value], [BtnStr]) VALUES (N'5', N'RoleFunctions', N'4', N'[13][12][16][14][15][19][20][21]', N'[{"funId":"25","btnStr":"1"},{"funId":"217","btnStr":"1"},{"funId":"218","btnStr":"1"},{"funId":"232","btnStr":"3"},{"funId":"233","btnStr":"3"},{"funId":"33","btnStr":"3"},{"funId":"200","btnStr":"3"},{"funId":"201","btnStr":"3"},{"funId":"210","btnStr":"3"},{"funId":"211","btnStr":"3"},{"funId":"214","btnStr":"3"},{"funId":"215","btnStr":"3"},{"funId":"41","btnStr":"3"},{"funId":"199","btnStr":"3"},{"funId":"202","btnStr":"3"},{"funId":"40","btnStr":"3"}]')
GO
GO
INSERT INTO [dbo].[jsh_userbusiness] ([Id], [Type], [KeyId], [Value], [BtnStr]) VALUES (N'16', N'UserRole', N'63', N'[4]', null)
GO
GO
SET IDENTITY_INSERT [dbo].[jsh_userbusiness] OFF
GO

-- ----------------------------
-- Indexes structure for table jsh_functions
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table jsh_functions
-- ----------------------------
ALTER TABLE [dbo].[jsh_functions] ADD PRIMARY KEY ([Id])
GO

-- ----------------------------
-- Indexes structure for table jsh_log
-- ----------------------------
CREATE INDEX [FKF2696AA13E226853] ON [dbo].[jsh_log]
([userID] ASC) 
GO

-- ----------------------------
-- Primary Key structure for table jsh_log
-- ----------------------------
ALTER TABLE [dbo].[jsh_log] ADD PRIMARY KEY ([id])
GO

-- ----------------------------
-- Indexes structure for table jsh_role
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table jsh_role
-- ----------------------------
ALTER TABLE [dbo].[jsh_role] ADD PRIMARY KEY ([Id])
GO

-- ----------------------------
-- Indexes structure for table jsh_user
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table jsh_user
-- ----------------------------
ALTER TABLE [dbo].[jsh_user] ADD PRIMARY KEY ([id])
GO

-- ----------------------------
-- Indexes structure for table jsh_userbusiness
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table jsh_userbusiness
-- ----------------------------
ALTER TABLE [dbo].[jsh_userbusiness] ADD PRIMARY KEY ([Id])
GO

-- ----------------------------
-- Foreign Key structure for table [dbo].[jsh_log]
-- ----------------------------
ALTER TABLE [dbo].[jsh_log] ADD FOREIGN KEY ([userID]) REFERENCES [dbo].[jsh_user] ([id]) ON DELETE NO ACTION ON UPDATE NO ACTION
GO
